﻿<div class="post-bottom-section">
    <h4>
        ${comments.count} comments</h4>

<div class="right">
        <ol class="commentlist">
          #foreach($item in $comments)
          
            <li class="depth-1">
                <div class="comment-info">
                    <img alt="" src="${themeurl}images/gravatar.jpg" class="avatar" height="40" width="40" />
                    <cite><a href="http://${item.SiteUrl}" target="_blank">${item.Name}</a> Says:
                        <br />
                        <span class="comment-data"><a href="#comment-63" title="">${item.CreateDate.tostring("yyyy-MM-dd HH:mm")}</a></span> </cite>
                </div>
                <div class="comment-text">
                    <p>
                #if($item.Staus==1)
                    ${item.content}
                #else
                    [待审核]
                #end</p>
                    <div class="reply">
                        <a rel="nofollow" class="reviewto" to="${item.Name}" href="#commentcontent">Reply</a>
                    </div>
                </div>
                 
            </li>
           #end
        </ol>
    </div>
</div>
<div class="post-bottom-section">
    <h4>
        Leave a Reply</h4>
    <div class="right">
        <form id="login">
        <span id="comment-nologin"><a href="/users/login.aspx">Login</a> | <a href="/users/register.aspx">
            register </a></span>
        </form>

        <form action="index.html" method="post" id="commentform">
        <input type="hidden" id="targetid" value="${post.ID}" />
        <p>
            <label for="name">Name (required)</label><br />
            <input id="username" name="username" value="" type="text" tabindex="1" />
        </p>
        <p>
            <label for="name">WebSite</label><br />
            <input id="siteurl" name="siteurl" value="" type="text" tabindex="1" />
        </p>
        <p>
            <label for="message">
                Your Message</label><br />
            <textarea id="commentcontent" name="commentcontent" rows="10" cols="20" tabindex="4"></textarea>
        </p>
        <p class="no-border">
            <input class="button" type="button" id="addcomment" value="Add Comment" onclick="return addComment();" tabindex="5" />
        </p>
        </form>

        
    </div>
</div>
 <script type="text/javascript" src="${siteurl}Assets/Scripts/comment.js"></script>
<script type="text/javascript">
    var ucookies = getCookies("User", "name");
    var urlcookies = getCookies("User", "url");
    alert(urlcookies);
    if (ucookies != "" && ucookies != null) {
        this.document.getElementById("comment-nologin").style.display = "none";
        $("#username").attr("value", ucookies);
        $("#siteurl").attr("value", urlcookies);

    }
    else {
        this.document.getElementById("comment-nologin").style.display = "";

    }

    $(".reviewto").bind("click", function () {
        var author = $(this).attr("to");
        
        $("#commentcontent").attr("value", "@" + author)

        $("#commentcontent").focus();

    });

    
</script>